import request from '@/utils/request'

export function fetchUserPage(params) {
  return request({ url: '/admin/user/page', method: 'get', params })
}

export function getUserById(id) {
  return request({ url: `/admin/user/${id}`, method: 'get' })
}

export function createUser(data) {
  return request({ url: '/admin/user', method: 'post', data })
}

export function updateUser(data) {
  return request({ url: '/admin/user', method: 'put', data })
}

export function deleteUser(id) {
  return request({ url: `/admin/user/${id}`, method: 'delete' })
}

export function deleteUserBatch(ids) {
  return request({ url: '/admin/user/batch', method: 'delete', data: ids })
}